<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<% 
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
	pageContext.setAttribute("basePath",basePath);
%>
<%
	String phone = (String)request.getSession().getAttribute("phone");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
		<title>个人中心</title>
		<link rel="icon" href="<%=basePath %>views/gj/img/favicon.png" type="image/x-icon">
		<link rel="stylesheet" href="<%=basePath %>views/lcx/layui-v2.5.5/layui/css/layui.css" />
		<link rel="stylesheet" href="<%=basePath %>views/lcx/layui-v2.5.5/layui/css/modules/layer/default/layer.css" />
		<link rel="stylesheet" href="<%=basePath %>views/lcx/css/personalCenter.css" />
		<script src="<%=basePath %>views/lcx/layui-v2.5.5/layui/layui.js"></script>
		<script type="text/javascript" src="<%=basePath %>views/lcx/js/jquery-3.3.1.min.js" ></script>
		<script type="text/javascript" src="<%=basePath %>views/lcx/js/personalCenter.js" ></script>
	</head>
	<body onload="startTime()">
		<input id="msg" type="hidden" value="${msg }">
		<div class="total-container">
			<div class="header">
				<div class="logo-img">
					<a href="index.html"><img title="返回首页" src="${basePath }views/lcx/img/logo.png"/></a>
				</div>
				<div class="header-time">
					<font>
						<span id="nowDateTimeSpan"></span>
					</font> 
					<div style="width: 240px; height: 50px;">
						<iframe frameborder="0" allowtransparency="true" src="http://i.tianqi.com/index.php?c=code&id=36&icon=5&num=1"></iframe>
					</div>
				</div>
				<div class="header-user">
					<c:choose>
						<c:when test="${user==null }">
							<div class="no-login">
								<a href="" class="login">登录</a>
								<a href="" class="login">注册</a>
							</div>
						</c:when>
						<c:otherwise>
							<div class="in-login" style="position: relative;">
								<c:choose>
									<c:when test="${user.head_photo==null }">
										<a href="${basePath }changephoto"><img title="上传头像" src="${basePath }views/lcx/img/2016061417302085.jpg"/></a>
									</c:when>
									<c:otherwise>
										<a href="${basePath }changephoto"><img title="上传头像" src="${user.head_photo }"/></a>
									</c:otherwise>
								</c:choose>
							</div> 
						</c:otherwise>
					</c:choose>
				</div>
				<div class="middle">
					<div class="Navigation">
						<ul>
							<li><a href="<%=basePath %>index.do">首页</a></li>
						<li><a href="<%=basePath %>views/user/list.jsp">非遗清单</a></li>
						<li><a href="<%=basePath %>views/zcs/answerpage/main.jsp">非遗知多少</a></li>
						<li><a href="<%=basePath %>views/zcs/answerpage/moyi_succeed_.jsp">传承现状</a></li>
						<li><a href="<%=basePath %>views/jzl/compony.jsp"><span>莫遗小窝</span></a></li>
						<li><a href="<%=basePath %>luntan">论坛</a></li>
						<li><a href="<%=basePath %>views/user/maptest.jsp">非遗一览</a></li>
						<li><a href="<%=basePath %>views/user/activity.jsp">活动公告</a></li>
						<c:if test="${user.status==1 }">
							<li><a href="${basePath}sysInit">系统设置</a></li>
						</c:if>
						</ul>
					</div>
				</div>
			</div>
			<div class="main">
				<div class="content-left">
					<ul class="layui-nav layui-nav-tree" lay-filter="test">
					  <li id="liq1" class="layui-nav-item">
					    <a href="${basePath}personInit">编辑资料</a></li>
					  <li id="liq1" class="layui-nav-item layui-nav-itemed">
					    <a href="${basePath}changephoto">上传头像</a></li>
					  <li id="liq2" class="layui-nav-item">
					    <a href="${basePath}updatePasswd">修改密码</a></li>
					  <li id="liq3" class="layui-nav-item">
					  	<a href="${basePath }activity">我的动态</a></li>
					  <li id="liq4" class="layui-nav-item">
					  	<a href="${basePath }relative">与我相关</a></li>
					</ul>
				</div>
				<div class="content-right uploadheadphoto" style="width: 710px;">
					<div style="text-align: left;">当前头像为：</div>
					<form action="${basePath }changehp" method="post" enctype="multipart/form-data">
						<div class="phoInfo">
							<c:choose>
								<c:when test="${user.head_photo==null}">
									<img src="${basePath }views/lcx/img/2016061417302085.jpg" title="点击切换" id="img" onclick="aaa()">
								</c:when>
								<c:otherwise>
									<img src="${user.head_photo}" title="点击切换" id="img" onclick="aaa()">
								</c:otherwise>
							</c:choose>
							<input id="input" style="display: none;" type="file" accept="image/*" onchange="showImg(this)"  name="headPhoto"/>
							<button id="qqupbtn" class="layui-btn" type="submit">确认保存</button>
						</div>
					</form>
				</div>
			</div>
			<div id="foot" class="foot">
				<hr class="layui-bg-orange">
				<div class="copyright">
					小莫2019
				</div>
				<div class="copyright">
					All Rights Reserved 版权所有，违者必究
				</div>
				<div class="copyright">
					河南省郑州市高新区科学大道100号
				</div>
				<div class="copyright">
					联系我们 邮箱：iezljin@163.com QQ：2313954270
				</div>
				<div class="footright">
					<div class="footblock">
						<img src="<%=basePath %>views/lcx/img/weichatQRCode.jpg" />
						<div>莫遗官方微信公众号</div>
					</div>
					<div class="footblock">
						<img src="<%=basePath %>views/lcx/img/weibo.png" />
						<div>莫遗官方微博</div>
					</div>
					<div class="footblock">
						<img src="<%=basePath %>views/lcx/img/QQtalk.jpg" />
						<div>莫遗官方QQ讨论群</div>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			$(function(){
				var a=$("#msg").val();
				if(a!=null&&a!=''){
					alert(a);
				}
			});
		</script>
		
	</body>
</html>